package com.gitee.xmhzzz.component.oss.template;

import com.aliyun.oss.OSSClient;
import com.gitee.xmhzzz.component.oss.config.OssConfig;

/**
 * @ClassName AOssTemplate
 * @Description
 * @Author wzq
 * @Date 2023/7/7 14:43
 * @Version 1.0
 */
public abstract class AOssTemplate {

    protected OSSClient createOSSClient(){
        OssConfig ossConfig = getOssConfig();
        OSSClient ossClient = new OSSClient(ossConfig.getEndpoint(),ossConfig.getAccessKeyId(), ossConfig.getAccessKeySecret());
        return ossClient;
    }

    protected void  shutdown(OSSClient ossClient){
        ossClient.shutdown();
    }

    protected abstract OssConfig getOssConfig();


}
